#ifndef __RELAY_CTRL_H__
#define __RELAY_CTRL_H__

#include "cmsis_os2.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"

#include "drv_gpio.h"
#include "pin.h"

#ifdef __cplusplus
extern "C" {
#endif

#define K1_PIN      GET_PIN(B, 11)
#define K2_PIN      GET_PIN(C, 0)
#define K3_PIN      GET_PIN(A, 0)
#define K4_PIN      GET_PIN(H, 2)
#define K5_PIN      GET_PIN(I, 9)
#define K6_PIN      GET_PIN(I, 10)
#define K1_PIN_DET  GET_PIN(H, 14)
#define K2_PIN_DET  GET_PIN(H, 13)

enum
{
    RELAY_K1 = 0,
    RELAY_K2,
    RELAY_K3,
    RELAY_K4,
    RELAY_K5,
    RELAY_K6
};

enum
{
    OFF = 0,
    ON
};

int relay_ctrl(int index, int level);
int get_relay_status(void);

#ifdef __cplusplus
}
#endif

#endif  /* __RELAY_CTRL_H__ */


